package com.xuetang9.BBS.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xuetang9.BBS.dao.SectionDao;
import com.xuetang9.BBS.domain.Section;
import com.xuetang9.BBS.service.SectionServic;

@Service
public class SectionServiceImpl implements SectionServic{
	
	@Autowired
	private SectionDao sectionDao;

	@Override
	public List<Section> getAllTopSection() {
		return sectionDao.findSectionByPid("0");
	}

	@Override
	public List<Section> getAllChildrenSection() {
		return sectionDao.selectChildrenSections();
	}

	@Override
	public boolean save(Section section) {
		return sectionDao.insertSection(section) == 1;
	}

}
